--work in progress...
exponentLimit = 10000   

dissolve exp = dissolve' exp 1 0
dissolve' exp n oddns
          | exp < exponentLimit = (exp,n,oddns)
          | (exp `mod` 2) /= 0 = dissolve' ((exp-1) `div` 2) (n*2) (oddns+1)
          | otherwise = dissolve' (exp `div` 2) (n*2) oddns

answer = 28433 * (2^exp)^n * 2^oddns
         where (exp,n,oddns) = dissolve 7830457

test x exp
     | x^exp == (x^newExp)^n * x^oddns = True
     | otherwise = False
       where (newExp,n,oddns) = dissolve exp

main = print $ answer
